package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.TuikuItemSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.TuikuItemSL;

@Component
public class TuikuItemSLConverter extends AbstractConverter<TuikuItemSL, TuikuItemSLDTO> {

    @Override
    public TuikuItemSL toModel(final TuikuItemSLDTO dto) {

        final TuikuItemSL model = new TuikuItemSL();

        model.setName(dto.getName());
        model.setCode(dto.getCode());
        model.setSpecifications(dto.getSpecifications());
        model.setSerialnumber(dto.getSerialnumber());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setManagementUserCode(dto.getManagementUserCode());
        model.setManagementUserName(dto.getManagementUserName());
        model.setTuikuLocation(dto.getTuikuLocation());
        model.setTuikuLocationName(dto.getTuikuLocationName());
        model.setStatus(dto.getStatus());
        return model;
    }

    @Override
    public TuikuItemSLDTO toDTO(final TuikuItemSL model, final boolean forListView) {
        final TuikuItemSLDTO dto = new TuikuItemSLDTO();
        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setCode(model.getCode());
        dto.setSpecifications(model.getSpecifications());
        dto.setSerialnumber(model.getSerialnumber());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setManagementUserCode(model.getManagementUserCode());
        dto.setManagementUserName(model.getManagementUserName());
        dto.setTuikuLocation(model.getTuikuLocation());
        dto.setTuikuLocationName(model.getTuikuLocationName());
        dto.setStatus(model.getStatus());
        return dto;
    }

}
